package feng.process.api.user;

import java.util.List;

import org.apache.log4j.Logger;

import feng.process.ProcessDataInfo;

/**
 * 环节人员查找器,根据不同的规则返回待办环节的人员信息
 * @author 冯昌硕
 * @create 2012-10-24 下午10:39:04
 */
public class UserSelecter {

    private static final Logger log = Logger.getLogger(UserSelecter.class);
    
    private IUserSelect userSelecter;
    
    public UserSelecter() throws Exception {
        userSelecter = ProcessDataInfo.userSelecter;
    }
    
    /**
     * 查询指定环节的待办人员ID
     * @param selectRole 人员查询规则
     * @param templeteName 流程模板
     * @param stepId 要查询的环节ID
     * @return 该环节的待办人员集合
     * @throws Exception 
     * @create 2012-10-29 下午8:20:12
     */
    public List<?> getUsersLst(String selectRole, String templeteName, String stepId) throws Exception {
        List<?> userLst = null;
        try {
            userLst = userSelecter.getWaitingUserIdLst(selectRole, templeteName, stepId);
        } catch(Exception e) {
            log.error("流程["+templeteName+"]:环节["+stepId+"]待办人员查询异常: " + e.toString());
            e.printStackTrace();
            throw e;
        }
        return userLst;
    }
}
